package com.daka.controller;

import com.daka.tools.Clock;
import com.daka.tools.DateUtil;

import java.util.Date;

/**
 * Created by yangx
 * CreateTime: 2016/9/18 15:07
 */
public class Test {
    public static void main(String []args){
        System.out.println(new Date());
        System.out.println(Clock.DEFAULT.getCurrentDate());
        System.out.println(Clock.DEFAULT.getCurrentDate().toString());

        String a ="2016-09-22";
        String b = "14";
        String c = "00";
        String d = "10";
        String e = "09";
        String f = "20";
        String startTime =  a+" "+b+":"+c;
        String endTime =   a+" "+b+":"+d;
        int targetTimes = 0;
        try {
            targetTimes = DateUtil.countMinutes(DateUtil.getDate(), endTime);
        } catch (Exception e1) {
            e1.printStackTrace();
        }
        System.out.println(targetTimes+"****0****");


        System.out.println("*****1******");
        Date start = DateUtil.getDateFormString("2015-11-08 15:29:49");
        Date start1 = DateUtil.getDateFormString("2015-11-08 16:29:49");
        if(DateUtil.getDateFormString("2015-11-08 15:29:49").getTime()<DateUtil.getDateFormString("2015-11-08 16:29:49").getTime()){
            System.out.println("!@#$%^&*@#$%^&@#$%^&*#$%^&$%^&");
        }
        DateUtil.date2Str(start, DateUtil.DATETIME_YYYY_MM_DD_HH_MM_SS);


        if(DateUtil.isOverLaps(a+" "+b+":"+c, a+" "+b+":"+d,  a+" "+b+":"+e,  a+" "+b+":"+f, "yyyy-MM-dd HH:mm") == true) {
            System.out.println("chongdie");
        }else {
            System.out.println("buchongdie ");
        }


    }

}
